﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true"
    CodeBehind="TeacherSettings.aspx.cs" Inherits="School.Pages.Teaching.TeacherSettings" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <h1>
                اعدادات المدرس</h1>
            <table>
                <tr>
                    <td>
                        اسم المدرس
                    </td>
                    <td>
                        <asp:TextBox ID="TxtTeacherName" runat="server"></asp:TextBox>
                        <asp:Button ID="Button1" runat="server" Text="بحث" onclick="Button1_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:HiddenField ID="HFTeacherId" runat="server" />
                        <asp:Label ID="LblNotFound" Font-Size="X-Large" ForeColor="Red" runat="server" Text="لا يوجد مدرس بهذا الاسم"
                            Visible="false"></asp:Label>
                        <asp:GridView ID="GVTeachers" runat="server" Width="100%" AutoGenerateColumns="false" CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter"
                            FooterStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" 
                            AlternatingRowStyle-CssClass="GridItemAltername" 
                            onrowcommand="GVTeachers_RowCommand">
                            <AlternatingRowStyle CssClass="GridItemAltername" />
                            <Columns>
                                <asp:BoundField DataField="Name" HeaderText="اسم المدرس" />
                                <asp:TemplateField Visible="false">
                                    <ItemTemplate>                                   
                                        <asp:Label ID="LblId" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:ButtonField ItemStyle-Width="1%" ButtonType="Button" Text="اختيار" CommandName="Select" />
                            </Columns>
                            <FooterStyle CssClass="GridHeaderFooter" />
                            <HeaderStyle CssClass="GridHeaderFooter" />
                            <PagerStyle CssClass="GridPager" />
                        </asp:GridView>
                        <asp:Panel ID="SubjectsPanel" runat="server" Visible="false">
                        <h2>المواد</h2>
                        <table>
                            <tr>
                                <td width="20%">الصف</td>
                                <td>
                                    <asp:DropDownList ID="DdlGrade" runat="server" 
                                        onselectedindexchanged="DdlGrade_SelectedIndexChanged" AutoPostBack="True">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td width="20%">المادة</td>
                                <td><asp:DropDownList ID="DdlSubject" runat="server"></asp:DropDownList></td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Button ID="Button2" runat="server" Text="حفظ" onclick="Button2_Click" /></td>                                
                            </tr>
                        </table>
                            <asp:GridView ID="GridView1" runat="server" Width="100%" 
                                AutoGenerateColumns="False" CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter"
                            FooterStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" 
                            AlternatingRowStyle-CssClass="GridItemAltername" onrowcommand="GridView1_RowCommand" 
                            >
                                <AlternatingRowStyle CssClass="GridItemAltername" />
                                <Columns>
                                    <asp:BoundField DataField="Grade" HeaderText="الصف" />
                                    <asp:BoundField DataField="Subject" HeaderText="المادة" />
                                    <asp:TemplateField Visible="false">
                                    <ItemTemplate>                                   
                                        <asp:Label ID="lblSId" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:ButtonField ItemStyle-Width="1%" ButtonType="Button" Text="حذف" CommandName="Delete" />
                                </Columns>
                                <FooterStyle CssClass="GridHeaderFooter" />
                                <HeaderStyle CssClass="GridHeaderFooter" />
                                <PagerStyle CssClass="GridPager" />
                            </asp:GridView>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
